{% extends "base.html" %}

{% load table_row_highlight %}

{% block extrahead %}
<script type='text/javascript' src='/appmedia/js/routines.js'></script>

{% endblock %}

{% block content %}
	
	<div class="form_layer">
		<h1>
		<img src="/appmedia/arrow-down.gif" onclick="ShowHide('tasks')"><img src="/appmedia/arrow-up.gif" onclick="ShowHide('tasks')">
		Tasks ({{tasks.count}})
		</h1>
		<div id="Menu">
			<a class="toolbar" id="archive_tasks" href="/archive_all_done_tasks/">
				<img src="/appmedia/delete.gif">
				Empty archive
			</a>
		</div>
	{% if tasks %}
		<div id="tasks">
			<table cellspacing="0">
			{% for task in tasks %}
				<tr class="{% odd_even_row forloop.counter 'odd' 'even' %}">
					<td nowrap width="80" id="task_is_done{{task.id}}">
						{% if task.done %}
						<img src="/appmedia/yes.gif"> done
						{% else %}
						<img src="/appmedia/no.gif" ondblclick="javascript:TaskIsDone({{task.id}})"> in progress
						{% endif %}
					</td>
					<td>
						{% if task.task_date %}
							<a href="/task/edit/{{task.id}}/" title="{{task.text}}">{{task.task_date}}</a>
						{% endif %}
					</td>
					<td>
					  	{% if task.project %}
							<a href="/task/edit/{{task.id}}/">{{task.project}}</a>
						{% endif %}
					</td>
					<td>
					  {% if task.customer %}
						<a href="/task/edit/{{task.id}}/">{{task.customer}}</a>
					  {% endif %}
					</td>
					<td>
						<a href="/task/edit/{{task.id}}/" title="{{task.text}}">{{task.name}}</a>
					</td>
					<td>
						<a href="/task/edit/{{task.id}}/">{{task.time_spent}} h</a>
					</td>
					<td width="12">
						<a href="/task/archive/{{task.id}}/"><img src="/appmedia/delete.gif"></a>
					</td>
				</tr>
			{% endfor %}
			</table>
		</div>
	{% endif %}
	</div>
	
{% endblock %}
